# @Time : 2024/4/17 09:20:22
# @Author : huangxh
# @Software: PyCharm
from fastapi import APIRouter, Request
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse

# index_blueprint = Blueprint('pages', __name__)
templates = Jinja2Templates(directory="templates")
index_router = APIRouter()

# 主页
@index_router.get('/', response_class=HTMLResponse)
async def main_page(request: Request):
    return templates.TemplateResponse('index.html', {"request": request})


# 首页
@index_router.get('/main', response_class=HTMLResponse)
async def index_main(request: Request):
    return templates.TemplateResponse('index/main.html', )


# IP管理页
@index_router.get('/ipconfig', response_class=HTMLResponse)
def ipconfig_main():
    return templates.TemplateResponse('index/ipconfig.html', )


@index_router.get('/index_v1', response_class=HTMLResponse)
def index_v1():
    return templates.TemplateResponse('demo/index_v1.html', )


@index_router.get('/index_v2', response_class=HTMLResponse)
def index_v2():
    return templates.TemplateResponse('demo/index_v2.html', )


@index_router.get('/index_v3', response_class=HTMLResponse)
def index_v3():
    return templates.TemplateResponse('demo/index_v3.html', )


@index_router.get('/index_v4', response_class=HTMLResponse)
def index_v4():
    return templates.TemplateResponse('demo/index_v4.html', )


@index_router.get('/index_v5', response_class=HTMLResponse)
def index_v5():
    return templates.TemplateResponse('demo/index_v5.html', )
